<template>
   <div class="produce-in-create-table-wrap">
    <el-table
      :data="tableData"
      style="width: 100%"
      :border="true"
      :fit="true"
      :stripe="true"
      size="mini"
      align="center">

      <el-table-column label="操作"
      min-width="140"
      align="center">
        <template slot-scope="scope">
          <el-button
            size="mini"
            plain
            type="primary"
            v-if="scope.$index===0"
            @click="add(scope.row)">新增</el-button>
          <el-button
            size="mini"
            plain
            type="danger"
            v-else
            @click="del(scope.row)">删除</el-button>
        </template>
      </el-table-column>

      <el-table-column
        prop="number"
        label="商品编号"
        min-width="100"
        align="center">
      </el-table-column>

      <el-table-column
        prop="order"
        label="商品名称"
        min-width="130"
        align="center">
      </el-table-column>

      <el-table-column
        prop="date"
        label="商品分类"
        min-width="130"
        align="center">
      </el-table-column>

      <el-table-column
        prop="state"
        label="型号"
        min-width="120"
        align="center">
      </el-table-column>

      <el-table-column
        prop="do_name"
        label="单位"
        min-width="120"
        align="center">
      </el-table-column>
      
      <el-table-column 
      label="入库数量"
      min-width="180"
      align="center">
        <template slot-scope="scope">
          <el-input 
          v-model="inCount" 
          placeholder="读取账号"></el-input>
        </template>
      </el-table-column>

      <el-table-column 
      label="备注"
      min-width="180"
      align="center">
        <template slot-scope="scope">
          <el-input 
          v-model="remark" 
          placeholder="读取账号"></el-input>
        </template>
      </el-table-column>
    </el-table>
    <deleteConfirm v-if="showMask" @closeDelete="closeDelete" @deleteConfirm="deleteConfirm"></deleteConfirm>
  </div>
</template>
<script lang="ts">
import Vue from 'vue';
import Component from 'vue-class-component';
import { Prop, Emit } from 'vue-property-decorator';
import ajaxResquest from '@/api/apiRequest';

@Component({})
export default class ProduceInCreateTable extends Vue {
  @Prop() tableData!: any[];
  inCount: string = '';
  remark: string = '';
  showMask: boolean = false;
  mounted() {}
  @Emit('add')
  add() {}
  @Emit('del')
  del() {}
}
</script>
<style lang="less">
.produce-in-create-table-wrap {
}
</style>
